USE [MoonwishOsAvatar]
GO

/****** Object:  Table [dbo].[T_FDT_ValueObject]    Script Date: 04/22/2012 14:18:10 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[T_FDT_ValueObject](
	[ValueObjectId] [nvarchar](50) NOT NULL,
	[ValueObjectClassId] [nvarchar](50) NOT NULL,
	[Code] [nvarchar](50) NULL,
	[Name] [nvarchar](50) NOT NULL,
	[OrderNo] [int] NULL,
	[DataStatus] [nvarchar](10) NOT NULL,
 CONSTRAINT [PK_FDT_ValueObject] PRIMARY KEY CLUSTERED 
(
	[ValueObjectId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[T_FDT_ValueObject]  WITH CHECK ADD  CONSTRAINT [FK_FDT_ValueObject_FDT_ValueObjectClass] FOREIGN KEY([ValueObjectClassId])
REFERENCES [dbo].[T_FDT_ValueObjectClass] ([ValueObjectClassId])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[T_FDT_ValueObject] CHECK CONSTRAINT [FK_FDT_ValueObject_FDT_ValueObjectClass]
GO

ALTER TABLE [dbo].[T_FDT_ValueObject]  WITH CHECK ADD  CONSTRAINT [CK_FDT_ValueObject.DataStatus] CHECK  (([DataStatus]='Disabled' OR [DataStatus]='Released' OR [DataStatus]='New'))
GO

ALTER TABLE [dbo].[T_FDT_ValueObject] CHECK CONSTRAINT [CK_FDT_ValueObject.DataStatus]
GO


